package com.agan.jvm.test01.lesson03;
/**
 * @author 阿甘
 * @see https://study.163.com/course/introduction/1211562809.htm?share=1&shareId=1028852228
 * @version 1.0
 * 注：如有任何疑问,欢迎加阿甘老师微信agan-java 进行讨论
 */
public class Singleton {
    private static Singleton instance = new Singleton();

    public static int x = 0;
    public static int y;

    private Singleton() {
        x ++;
        y ++;
    }
    public static Singleton getInstance() {
        return instance;
    }
    public static void main(String[] args) {
        Singleton singleton = getInstance();
        System.out.println(x);
        System.out.println(y);
    }
}
